package com.zy.cloud.controller;

import com.zy.cloud.entity.CommonResult;
import com.zy.cloud.entity.User;
import com.zy.cloud.service.UserFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName: UserFeignController
 * @Description: #TODO
 * @Author: yanzy
 * @Date: 2021/3/3 12:34
 */
@RestController
@Slf4j
public class UserFeignController {

    @Resource
    private UserFeignService userFeignService;

    @GetMapping(value = "/user/feign/{id}")
    public CommonResult<User> selectOne(@PathVariable("id") Long id) {
        return userFeignService.selectOne(id);
    }

    @GetMapping("/user/feign/timeout")
    public String getServerPort() {
        return userFeignService.getServerPort();
    }
}
